<?php

include 'confidential_settings.php';
// This include contains 5 variables:
//  - db_name: database name
//  - table_name: table name
//  - username: username
//  - password: password
//  - localhost: host name

$dbh=mysql_connect ($localhost, $username, $password) or die('Cannot connect to the database because: ' . mysql_error());

mysql_select_db ($db_name) or die(mysql_error()); 

$nr = $_GET['nr'];
$nr = mysql_real_escape_string($nr);
$val = $_GET['val'];
$val = mysql_real_escape_string($val);

mysql_query("INSERT INTO $table_name
(nr, val) VALUES($nr, $val) ") or die(mysql_error());  

mysql_close($dbh);

?>
